package com.forward;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
/**
 * @Author: shafei
 * @Date: 2025/02/07 11:31
 * @description：
 **/
public class Dayinji3 {
    public static void main(String argv[]) throws IOException {

        Socket clientSocket = new Socket("192.168.50.20", 9100);
        DataOutputStream outToServer = new DataOutputStream(clientSocket.getOutputStream());

        String one = "介意勿拍拆袋默认微瑕";
        String two = "ID:__________";
        String three = "成交:";
        String four = "05";
        String five = "条形码";
        String six = "12.14";
        String seven = "C3269-0005";
        String code1 =
                "{PC001;0140,0120,2,2,r,00,B="+one+"|}" +
                        "{PC002;0140,0320,2,2,r,00,B="+two+"|}" +
                        "{PC003;0140,0440,2,2,r,00,B="+three+"|}" +
                        "{PC004;0500,0400,8,8,r,00,B="+four+"|}" +
                        "{PC006;0140,0600,1,1,r,00,B="+six+"|}" +
                        "{PC007;0340,0600,2,2,r,00,B="+seven+"|}" +
                        "{XS;I,0001,0000C5000|}";
        String code2 = "{XB00;0140,0400,T,L,06,A,0,M2="+five+"|}" +
                "{XS;I,0001,0000C5000|}";
        outToServer.write(code1.getBytes("gb2312"));
        outToServer.write(code2.getBytes("utf-8"));
        clientSocket.close();

    }
}
